Integrand size = 14, antiderivative size = 89 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\left (a^2-b^2\right ) x+\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d}+\frac {a b \tan ^2(c+d x)}{d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan ^5(c+d x)}{5 d} \]
(a^2-b^2)*x+2*a*b*ln(cos(d*x+c))/d+b^2*tan(d*x+c)/d+a*b*tan(d*x+c)^2/d-1/3 *b^2*tan(d*x+c)^3/d+1/5*b^2*tan(d*x+c)^5/d
Result contains complex when optimal does not.
Time = 0.53 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.20 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\frac {-15 i \left ((a-i b)^2 \log (i-\tan (c+d x))-(a+i b)^2 \log (i+\tan (c+d x))\right )+30 b^2 \tan (c+d x)+30 a b \tan ^2(c+d x)-10 b^2 \tan ^3(c+d x)+6 b^2 \tan ^5(c+d x)}{30 d} \]
((-15*I)*((a - I*b)^2*Log[I - Tan[c + d*x]] - (a + I*b)^2*Log[I + Tan[c + d*x]]) + 30*b^2*Tan[c + d*x] + 30*a*b*Tan[c + d*x]^2 - 10*b^2*Tan[c + d*x] ^3 + 6*b^2*Tan[c + d*x]^5)/(30*d)
Time = 0.27 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4144, 2341, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \tan (c+d x)^3\right )^2dx\) |
\(\Big \downarrow \) 4144 |
\(\displaystyle \frac {\int \frac {\left (b \tan ^3(c+d x)+a\right )^2}{\tan ^2(c+d x)+1}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 2341 |
\(\displaystyle \frac {\int \left (b^2 \tan ^4(c+d x)-b^2 \tan ^2(c+d x)+2 a b \tan (c+d x)+b^2+\frac {a^2-2 b \tan (c+d x) a-b^2}{\tan ^2(c+d x)+1}\right )d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\left (a^2-b^2\right ) \arctan (\tan (c+d x))+a b \tan ^2(c+d x)-a b \log \left (\tan ^2(c+d x)+1\right )+\frac {1}{5} b^2 \tan ^5(c+d x)-\frac {1}{3} b^2 \tan ^3(c+d x)+b^2 \tan (c+d x)}{d}\) |
((a^2 - b^2)*ArcTan[Tan[c + d*x]] - a*b*Log[1 + Tan[c + d*x]^2] + b^2*Tan[ c + d*x] + a*b*Tan[c + d*x]^2 - (b^2*Tan[c + d*x]^3)/3 + (b^2*Tan[c + d*x] ^5)/5)/d
3.4.76.3.1 Defintions of rubi rules used
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* (a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(a + b* (ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 0.09 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.92
method | result | size |
parts | \(x \,a^{2}+\frac {b^{2} \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a b \tan \left (d x +c \right )^{2}}{d}-\frac {a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) | \(82\) |
derivativedivides | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{5}}{5}-\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+a b \tan \left (d x +c \right )^{2}+b^{2} \tan \left (d x +c \right )-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(85\) |
default | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{5}}{5}-\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+a b \tan \left (d x +c \right )^{2}+b^{2} \tan \left (d x +c \right )-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(85\) |
parallelrisch | \(-\frac {-3 b^{2} \tan \left (d x +c \right )^{5}+5 b^{2} \tan \left (d x +c \right )^{3}-15 a^{2} d x +15 b^{2} d x -15 a b \tan \left (d x +c \right )^{2}+15 a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )-15 b^{2} \tan \left (d x +c \right )}{15 d}\) | \(85\) |
norman | \(\left (a^{2}-b^{2}\right ) x +\frac {b^{2} \tan \left (d x +c \right )}{d}+\frac {a b \tan \left (d x +c \right )^{2}}{d}-\frac {b^{2} \tan \left (d x +c \right )^{3}}{3 d}+\frac {b^{2} \tan \left (d x +c \right )^{5}}{5 d}-\frac {a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) | \(90\) |
risch | \(-2 i a b x +x \,a^{2}-x \,b^{2}-\frac {4 i a b c}{d}+\frac {2 b \left (45 i b \,{\mathrm e}^{8 i \left (d x +c \right )}+30 a \,{\mathrm e}^{8 i \left (d x +c \right )}+90 i b \,{\mathrm e}^{6 i \left (d x +c \right )}+90 a \,{\mathrm e}^{6 i \left (d x +c \right )}+140 i b \,{\mathrm e}^{4 i \left (d x +c \right )}+90 a \,{\mathrm e}^{4 i \left (d x +c \right )}+70 i b \,{\mathrm e}^{2 i \left (d x +c \right )}+30 a \,{\mathrm e}^{2 i \left (d x +c \right )}+23 i b \right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(171\) |
x*a^2+b^2/d*(1/5*tan(d*x+c)^5-1/3*tan(d*x+c)^3+tan(d*x+c)-arctan(tan(d*x+c )))+a*b*tan(d*x+c)^2/d-a*b/d*ln(1+tan(d*x+c)^2)
Time = 0.28 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.96 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\frac {3 \, b^{2} \tan \left (d x + c\right )^{5} - 5 \, b^{2} \tan \left (d x + c\right )^{3} + 15 \, a b \tan \left (d x + c\right )^{2} + 15 \, {\left (a^{2} - b^{2}\right )} d x + 15 \, a b \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 15 \, b^{2} \tan \left (d x + c\right )}{15 \, d} \]
1/15*(3*b^2*tan(d*x + c)^5 - 5*b^2*tan(d*x + c)^3 + 15*a*b*tan(d*x + c)^2 + 15*(a^2 - b^2)*d*x + 15*a*b*log(1/(tan(d*x + c)^2 + 1)) + 15*b^2*tan(d*x + c))/d
Time = 0.15 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.06 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\begin {cases} a^{2} x - \frac {a b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {a b \tan ^{2}{\left (c + d x \right )}}{d} - b^{2} x + \frac {b^{2} \tan ^{5}{\left (c + d x \right )}}{5 d} - \frac {b^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} + \frac {b^{2} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan ^{3}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \]
Piecewise((a**2*x - a*b*log(tan(c + d*x)**2 + 1)/d + a*b*tan(c + d*x)**2/d - b**2*x + b**2*tan(c + d*x)**5/(5*d) - b**2*tan(c + d*x)**3/(3*d) + b**2 *tan(c + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c)**3)**2, True))
Time = 0.29 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.93 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=a^{2} x + \frac {{\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} b^{2}}{15 \, d} - \frac {a b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{d} \]
a^2*x + 1/15*(3*tan(d*x + c)^5 - 5*tan(d*x + c)^3 - 15*d*x - 15*c + 15*tan (d*x + c))*b^2/d - a*b*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/ d
Leaf count of result is larger than twice the leaf count of optimal. 1005 vs. \(2 (85) = 170\).
Time = 1.46 (sec) , antiderivative size = 1005, normalized size of antiderivative = 11.29 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\text {Too large to display} \]
1/15*(15*a^2*d*x*tan(d*x)^5*tan(c)^5 - 15*b^2*d*x*tan(d*x)^5*tan(c)^5 + 15 *a*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c )^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^5*tan(c)^5 - 75*a^2*d*x*tan(d*x )^4*tan(c)^4 + 75*b^2*d*x*tan(d*x)^4*tan(c)^4 + 15*a*b*tan(d*x)^5*tan(c)^5 - 75*a*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2* tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^4*tan(c)^4 - 15*b^2*tan(d* x)^5*tan(c)^4 - 15*b^2*tan(d*x)^4*tan(c)^5 + 150*a^2*d*x*tan(d*x)^3*tan(c) ^3 - 150*b^2*d*x*tan(d*x)^3*tan(c)^3 + 15*a*b*tan(d*x)^5*tan(c)^3 - 45*a*b *tan(d*x)^4*tan(c)^4 + 15*a*b*tan(d*x)^3*tan(c)^5 + 5*b^2*tan(d*x)^5*tan(c )^2 + 150*a*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x )^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^3*tan(c)^3 + 75*b^2*ta n(d*x)^4*tan(c)^3 + 75*b^2*tan(d*x)^3*tan(c)^4 + 5*b^2*tan(d*x)^2*tan(c)^5 - 150*a^2*d*x*tan(d*x)^2*tan(c)^2 + 150*b^2*d*x*tan(d*x)^2*tan(c)^2 - 45* a*b*tan(d*x)^4*tan(c)^2 + 60*a*b*tan(d*x)^3*tan(c)^3 - 45*a*b*tan(d*x)^2*t an(c)^4 - 3*b^2*tan(d*x)^5 - 25*b^2*tan(d*x)^4*tan(c) - 150*a*b*log(4*(tan (d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^ 2 + tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 - 150*b^2*tan(d*x)^3*tan(c)^2 - 150 *b^2*tan(d*x)^2*tan(c)^3 - 25*b^2*tan(d*x)*tan(c)^4 - 3*b^2*tan(c)^5 + 75* a^2*d*x*tan(d*x)*tan(c) - 75*b^2*d*x*tan(d*x)*tan(c) + 45*a*b*tan(d*x)^3*t an(c) - 60*a*b*tan(d*x)^2*tan(c)^2 + 45*a*b*tan(d*x)*tan(c)^3 + 5*b^2*t...
Time = 11.83 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.31 \[ \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}+\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5\,d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a+b\right )\,\left (a-b\right )}{a^2-b^2}\right )\,\left (a+b\right )\,\left (a-b\right )}{d}-\frac {a\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d} \]